<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
 <head>
  <title>inputEx - Calendar Widget Usage</title>

<!-- YUI CSS -->
<link rel="stylesheet" type="text/css" href="../lib/yui/reset-fonts/reset-fonts.css">
<link rel="stylesheet" type="text/css" href="../lib/yui/container/assets/container.css"> 
<link rel="stylesheet" type="text/css" href="../lib/yui/assets/skins/sam/skin.css">

<!-- InputEx CSS -->
<link type='text/css' rel='stylesheet' href='../css/inputEx.css' />

<!-- Demo CSS -->
<link rel="stylesheet" type="text/css" href="css/demo.css"/>
<link rel="stylesheet" type="text/css" href="css/dpSyntaxHighlighter.css">

 </head>

 <body>

<p class='demoTitle'>inputEx - DDList Widget Usage</p>


<!-- Example 1 -->
<div class='exampleDiv'>

	<p class="title">Basic DDList Widget creation</p>
	
	<p>Use the following code to create a basic inputEx DDList Widget.</p>

	<div class='demoContainer' id='container1'> </div>

	<div class='codeContainer'>
				<textarea name="code" class="JScript">
			new YAHOO.inputEx.widget.DDList({parentEl: 'container1', value: ['I was in first position !', 'I\'m second.', 'Third element']});
		</textarea>
			</div>

</div>


<!-- Example 2 -->
<div class='exampleDiv'>

	<p class="title">Numbered list</p>
	
	<p>Display the item # by changing CSS style only :</p>

	<style>
	#numberedList li {
		list-style-type:decimal;
		margin-left:20px;
	}
	</style>
	<div class='demoContainer' id='container2'> </div>

	<div class='codeContainer'>
				<textarea name="code" class="JScript">
			new YAHOO.inputEx.widget.DDList({id:'numberedList', parentEl: 'container2', value: ['I was in first position !', 'I\'m second.', 'Third element']});
			
			/* Style */
			#numberedList li {
				list-style-type:decimal;
				margin-left:20px;
			}
			
		</textarea>
			</div>

</div>




<!-- Example 3 -->
<div class='exampleDiv'>

	<p class="title">itemRemoved Event</p>
	
	<p>Use the following code to listen for the itemRemoved Event:</p>

	<div class='demoContainer' id='container3'> </div>

	<div class='codeContainer'>
				<textarea name="code" class="JScript">
			var list = new YAHOO.inputEx.widget.DDList({parentEl: 'container3', value: ['I was in first position !', 'I\'m second.', 'Third element']});
			list.itemRemovedEvt.subscribe(function() {
					alert("removed !");
			});
		</textarea>
			</div>

</div>



<!-- Example 4 -->
<div class='exampleDiv'>

	<p class="title">listReordered Event</p>
	
	<p>Use the following code to listen for the listReordered Event:</p>

	<div class='demoContainer' id='container4'> </div>

	<div class='codeContainer'>
				<textarea name="code" class="JScript">
			var list = new YAHOO.inputEx.widget.DDList({parentEl: 'container4', value: ['I was in first position !', 'I\'m second.', 'Third element']});
			list.listReorderedEvt.subscribe(function() {
					alert("reordered !");
			});
		</textarea>
			</div>

</div>

<!-- YUI Library -->
<script type="text/javascript" src="../lib/yui/yahoo/yahoo-min.js"></script> 
<script type="text/javascript" src="../lib/yui/dom/dom-min.js"></script> 
<script type="text/javascript" src="../lib/yui/event/event-min.js"></script>
<script type="text/javascript" src="../lib/yui/dragdrop/dragdrop-min.js"></script>


<!-- InputEx -->
<script src="../js/inputex.js"  type='text/javascript'></script>
<script src="../js/Field.js"  type='text/javascript'></script>
<script src="../js/widgets/ddlist.js" type='text/javascript'></script>

<script>

YAHOO.util.Event.addListener(window, 'load', function() {

	// Example 1
	new YAHOO.inputEx.widget.DDList({parentEl: 'container1', value: ['I was in first position !', 'I\'m second.', 'Third element']});
	
	// Example 2
	new YAHOO.inputEx.widget.DDList({id:'numberedList', parentEl: 'container2', value: ['I was in first position !', 'I\'m second.', 'Third element']});

	// Example 3
	var list = new YAHOO.inputEx.widget.DDList({parentEl: 'container3', value: ['I was in first position !', 'I\'m second.', 'Third element']});
	list.itemRemovedEvt.subscribe(function() {
			alert("removed !");
	});
	
	// Example 4
	var list = new YAHOO.inputEx.widget.DDList({parentEl: 'container4', value: ['I was in first position !', 'I\'m second.', 'Third element']});
	list.listReorderedEvt.subscribe(function() {
			alert("reordered !");
	});
	
});

</script>

<script src="js/dpSyntaxHighlighter.js"></script>
<script language="javascript"> 
dp.SyntaxHighlighter.HighlightAll('code');
</script>

 </body>
</html>